<?php 
	$tinhthanh = $viewModel->get('tinhthanh'); 
	$diadiemthamquans = $viewModel->get('diadiemthamquans'); 
	$diadiemdulichs = $viewModel->get('diadiemdulichs'); 
	$diadiemluutrus = $viewModel->get('diadiemluutrus'); 
	$diadiemanuongs = $viewModel->get('diadiemanuongs'); 
	$diadiemkhacs = $viewModel->get('diadiemkhacs'); 
	$baiviets = $viewModel->get('baiviets'); 
 ?>
<section class="main_content">
		<div class="container">
			<div class="row">
				<p class="sitemap"><a href="<?php echo BASE_URL ?>">Trang chủ</a> <span class="glyphicon glyphicon-play"></span> <?php echo $tinhthanh->TenTinh ?> </p>
				<div class="col-xs-12 col-md-12">
					<div class="col-xs-12 col-md-4">
						
						<h1 class="title_province"><span class="glyphicon glyphicon-map-marker"></span> <?php echo $tinhthanh->TenTinh ?></h1>
					
					</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#description">
									<span class="glyphicon glyphicon-th-large icon1"></span>
									<p class="title2">Giới thiệu</p>
								</a>
							</div>
						</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#map_zone">
									<span class="glyphicon glyphicon-map-marker icon1"></span>
									<p class="title2">Bản đồ</p>
								</a>
							</div>
						</div>
						
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#location">
									<span class="glyphicon glyphicon-record icon1"></span>
									<p class="title2">Điểm đến</p>
								</a>
							</div>
						</div>
						<div class="col-md-2 col-xs-6">
							<div class="metro-bottom">
								<a href="#articles">
									<span class="glyphicon glyphicon-bookmark icon1"></span>
									<p class="title2">Bài viết</p>
								</a>
							</div>
						</div>
					
					
				
				</div>
			</div>
			<div class="row">
				<div class="col-md-8">	
					<h2 class="module" id="description">Giới thiệu</h2>												
					<p class="description">
						<?php echo $tinhthanh->MoTa ?>
					</p>	
				</div>
				<div class="col-md-4 video">
					<iframe width="96%" height="250" src="//<?php echo $tinhthanh->Video ?>?autoplay=1" frameborder="0" allowfullscreen></iframe>
				</div>
			</div>
			<div class="row">
				<div class="col-xs-12 col-md-12">
					<h2 class="module" id="map_zone">Bản đồ du lịch <?php echo $tinhthanh->TenTinh ?></h2>
					<div class="map" id="map">
						
					</div>
					<script type="text/javascript">
					      function initialize() {
						      	var myLatlng = new google.maps.LatLng(<?php echo $tinhthanh ->ViDo ?>,<?php echo $tinhthanh ->KinhDo ?>);
						        var mapOptions = {
						          center: myLatlng,
						          zoom: 14
						        };
						        var map = new google.maps.Map(document.getElementById('map'),
						            mapOptions);
						       	var infoWindow = new google.maps.InfoWindow;

					        // current place					        
					      		
					      		var contentString = '<div class="row1 info_province">'+
					       							'<div class="col-md-4">'+
						       						'<img src="<?php echo PATH_IMAGE.$tinhthanh->HinhAnh ?>" class="image_province">'+	
					       							'</div>'+
					       							'<div class="col-md-8">'+
						       							'<h1><?php echo $tinhthanh->TenTinh; ?></h1>'+
						       							'<span class="glyphicon glyphicon-eye-open"></span> '+
						       							'<?php echo $tinhthanh->SoLuotXem; ?> '+
						       							'  	<span class="glyphicon glyphicon-map-marker"></span>     '+
						       							'<?php echo $tinhthanh->SoDiaDiem; ?>'+
					       							'</div>'+
					       						'</div>';
					       		var marker = new google.maps.Marker({
						            map: map,
						            position: myLatlng,
						            icon: 'http://hoangquancantho.com.vn/wp-content/themes/phuan/images/map/single-family-home-map-icon.png'
						          });
					       		infoWindow.setContent(contentString);
						        infoWindow.open(map, marker);
						        bindInfoWindow(marker, map, infoWindow, contentString);


					        //end curent provine
					        // data place in province
					     	<?php foreach($diadiemdulichs as $diadiemdulich) { ?>
					      		var point = new google.maps.LatLng(<?php echo $diadiemdulich ->ViDo ?>,
						              <?php echo $diadiemdulich ->KinhDo ?>);
					      		
					      		var contentString = '<div class="row1 info_place">'+
					       							'<div class="col-md-4">'+
						       						'<img src="<?php echo PATH_IMAGE_PLACE.$diadiemdulich->HinhAnh ?>" class="image_place">'+	
					       							'</div>'+
					       							'<div class="col-md-8">'+
						       							'<h1><?php echo $diadiemdulich->TenDiem; ?></h1>'+
						       							'<?php echo $diadiemdulich->DiaChi; ?>'+
					       							'</div>'+
					       						'</div>';
					       		<?php $icon = PATH_ICON.$diadiemdulich->LoaiDiaDiem.'.png'; ?>
					       		var marker = new google.maps.Marker({
						            map: map,
						            position: point,
						            icon: '<?php echo $icon ?>'
						            
						          });
					       		bindInfoWindow(marker, map, infoWindow, contentString);
					      	<?php } ?> 
					        
					      }
					      //end  function initialize()
					      function bindInfoWindow(marker, map, infoWindow, html) {
						      google.maps.event.addListener(marker, 'click', function() {
						        infoWindow.setContent(html);
						        infoWindow.open(map, marker);
						      });
    						}
					      
					      google.maps.event.addDomListener(window, 'load', initialize);
					 </script>
				</div>
				<div class="col-xs-12 col-md-12">
					<ul class="note">
						<li><img src="<?php echo PATH_ICON.'dia-diem-tham-quan.png' ?>" alt=""><span class="note-right">Địa điểm tham quan</span></li>
						<li><img src="<?php echo PATH_ICON.'khach-san.png' ?>" alt=""><span class="note-right">Khách sạn</span></li>
						<li><img src="<?php echo PATH_ICON.'resort.png' ?>" alt=""><span class="note-right">Resort</span></li>
						<li><img src="<?php echo PATH_ICON.'nha-hang.png' ?>" alt=""><span class="note-right">Nhà hàng</span></li>
						<li><img src="<?php echo PATH_ICON.'bai-tam.png' ?>" alt=""><span class="note-right">Bãi tắm</span></li>

						<li><img src="<?php echo PATH_ICON.'quan-cafe.png' ?>" alt=""><span class="note-right">Quán cafe</span></li>
						<li><img src="<?php echo PATH_ICON.'quan-bar.png' ?>" alt=""><span class="note-right">Quán bar</span></li>
						<li><img src="<?php echo PATH_ICON.'quan-an.png' ?>" alt=""><span class="note-right">Quán ăn</span></li>
						<li><img src="<?php echo PATH_ICON.'truong-hoc.png' ?>" alt=""><span class="note-right">Trường học</span></li>
						
					</ul>
				</div>
			</div>
			
			<div class="row">
				<div class="col-xs-12 col-md-12">
							<h2 class="module" id="location"><?php if($diadiemthamquans or $diadiemluutrus or $diadiemanuongs ){echo 'Điểm đến';} ?></h2>
							<div class="row">
								<div class="col-xs-6 col-md-3">
									<?php if($diadiemthamquans){echo '<h3><span class="glyphicon glyphicon glyphicon-map-marker"></span> Địa điểm tham quan</h3>';} ?> 
									<?php foreach ($diadiemthamquans as $diadiemthamquan) {?>                                    
					  					<div class="media">
										  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemthamquan->Alias ?>">
										    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemthamquan->HinhAnh ?>" alt="...">
										  </a>
										  <div class="media-body">
										    <h4 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemthamquan->Alias ?>"><?php echo $diadiemthamquan->TenDiem ?></a></h4>
										    <p class="address">
												<?php 
														if (strlen($diadiemthamquan->DiaChi)<40)
														{
															echo $diadiemthamquan->DiaChi;
														}
														else
														{
															echo substr($diadiemthamquan->DiaChi, 0, 40).'...';
														}
												 ?>
										    </p>
										    <p><span class="rate type_location"><?php echo $diadiemthamquan->TenLoaiDiaDiem ?></span><span class="distance"><?php echo number_format($diadiemthamquan->distance,2) ?> km</span></p>
										  </div>
										</div>
									<?php } ?>

								</div>	
								<!-- Khách sạn -->
								<div class="col-xs-6 col-md-3">
									<?php if($diadiemluutrus){echo '<h3><span class="glyphicon glyphicon-tower"></span> Lưu trú</h3>';} ?> 
									<?php foreach ($diadiemluutrus as $diadiemluutru) { ?>                                    
					  					<div class="media">
										  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemluutru->Alias ?>">
										    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemluutru->HinhAnh ?>" alt="...">
										  </a>
										  <div class="media-body">
										    <h4 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemluutru->Alias ?>"><?php echo $diadiemluutru->TenDiem ?></a></h4>
										    <p class="address">
										    	<?php 
														if (strlen($diadiemluutru->DiaChi)<40)
														{
															echo $diadiemluutru->DiaChi;
														}
														else
														{
															echo substr($diadiemluutru->DiaChi, 0, 40).'...';
														}
												 ?>
										    <p><span class="rate type_location"><?php echo $diadiemluutru->TenLoaiDiaDiem ?></span><span class="distance"><?php echo number_format($diadiemluutru->distance,2) ?> km</span></p>
										  </div>
										</div>
									<?php } ?>
								</div>
								<!-- Nhà hàng -->
								<div class="col-xs-6 col-md-3">
									<?php if($diadiemanuongs){echo '<h3><span class="glyphicon glyphicon-cutlery"></span> Ăn uống</h3>';} ?> 
									<?php foreach ($diadiemanuongs as $diadiemanuong) { ?>                                    
					  					<div class="media">
										  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemanuong->Alias ?>">
										    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemanuong->HinhAnh ?>" alt="...">
										  </a>
										  <div class="media-body">
										    <h4 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemanuong->Alias ?>"><?php echo $diadiemanuong->TenDiem ?></a></h4>
										    <p class="address"><?php echo $diadiemanuong->DiaChi ?></p>
										    <p><span class="rate type_location"><?php echo $diadiemanuong->TenLoaiDiaDiem ?></span><span class="distance"><?php echo number_format($diadiemanuong->distance,2) ?> km</span></p>
										  </div>
										</div>
									<?php } ?>
								</div>
								<!-- Quán ăn -->
								<div class="col-xs-6 col-md-3">
									<?php if($diadiemkhacs){echo '<h3><span class="glyphicon glyphicon-record"></span>  Khác</h3>';} ?>
									<?php foreach ($diadiemkhacs as $diadiemkhac) { ?>                                    
					  					<div class="media">
										  <a class="pull-left" href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemkhac->Alias ?>">
										    <img class="media-object" height="70px" width="70px" src="<?php echo PATH_IMAGE_PLACE.$diadiemkhac->HinhAnh ?>" alt="...">
										  </a>
										  <div class="media-body">
										    <h4 class="media-heading"><a href="<?php echo BASE_URL.'diadiemdulich/place/'.$diadiemkhac->Alias ?>"><?php echo $diadiemkhac->TenDiem ?></a></h4>
										    <p class="address"><?php echo $diadiemkhac->DiaChi ?></p>
										    <p><span class="rate type_location"><?php echo $diadiemkhac->TenLoaiDiaDiem ?></span><span class="distance"><?php echo number_format($diadiemkhac->distance,2) ?> km</span></p>
										  </div>
										</div>
									<?php } ?>
								</div>
							</div>		
					<?php if(!empty($baiviets)) { ?>
					<h2 class="module" id="articles">Bài viết về <?php echo $tinhthanh->TenTinh; ?></h2>	
					<div class="row">
					<?php foreach ($baiviets as $baiviet) { ?>                                    
						  <div class="col-xs-12 col-md-6">
						  		<div class="media">
									  <a class="pull-left" href="#">
									    <img class="media-object" height="70px" width="70px" src="<?php if(!empty($baiviet->AnhThumb)){echo $baiviet->AnhThumb;}else{echo 'http://collectionsonline.nmsi.ac.uk/mobiusicons/no_image.jpg';}  ?>" alt="...">
									  </a>
									  <div class="media-body">
									    <h4 class="media-heading"><a href="#"><?php echo $baiviet->TieuDe ?></a></h4>
									    <p><?php echo $baiviet->MoTa ?></p>
									  </div>
								</div>
						  </div>
					 <?php } ?>		  
					</div>	
					<?php 	} ?>											
				</div>
					<!-- Map -->
				

  				
			</div>
		<div>
	</section>
	<hr>